#include"player.h"
#include<QIcon>
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include<QGraphicsView>
#include<QGraphicsScene>
#include<QIcon>
#include<QApplication>
#include"score.h"
#include"health.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    //编辑左上角图片
    QApplication::setWindowIcon(QIcon(":/images/back.jpg"));
    a.setApplicationDisplayName("工作细胞");

    //创建角色
    Player * player=new Player;
    //创建背景
    QGraphicsScene*scene=new QGraphicsScene;
    scene->addItem(player);
    scene->setSceneRect(0,0,1000,550);
    scene->setBackgroundBrush(QImage(":/images/back.jpg"));
    //创建分数
    scene->addItem(&Score::getInstance());
    //创建健康值
    scene->addItem(&Health::getInstance());
    //锁定游戏状态
    scene->setStickyFocus(true);



    QGraphicsView view(scene);
    view.setFixedSize(1000,550);
    view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view.show();




    return a.exec();
}
